package entities;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import api.entitites.Entities;
import api.entitites.IMaster;
import api.entitites.IOrder;

@Entity
@Table(name = "masters")
public class Master implements IMaster,Entities {
	public Master() {

	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id_master")
	private Integer id;

	@Column(name = "master_name")
	private String name;

	@Column(name = "employment_master")
	private Boolean employment = new Boolean(false);

	@OneToOne(cascade = CascadeType.ALL, targetEntity = Order.class, mappedBy = "master")
	@JoinColumn(nullable = true)
	private IOrder order;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getEmployment() {
		return employment;
	}

	public void setEmployment(Boolean employment) {
		this.employment = employment;
	}

	public IOrder getOrder() {
		return order;
	}

	public void setOrder(IOrder order) {
		this.order = order;
	}

}
